<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header('新增来电记录')"></head>
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
<style>

</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal" id="inputForm" th:object="${telGetDeal}">
        <h4 class="form-header h4">来电人信息</h4>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>地区：</label>
                    <div class="col-sm-9">

                        <select name="fmAreaNo" id="fmAreaNo" onchange="dropChgSendTextOnly(this,'fmAreaName');"
                                th:with="district=${@commonServiceImpl.findArea()}" class="form-control formSelect" required>
                            <option value="">--请选择--</option>
                            <option th:each="item : ${district}" th:text="${item['CSText']}"
                                    th:value="${item['CSValue']}"></option>
                        </select>
                        <input type="hidden" id="fmAreaName" name="fmAreaName"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">地址：</label>
                    <div class="col-sm-9">
                        <input name="fmAddress" autocomplete="off" placeholder="请输入地址" class="form-control" type="text"
                               maxlength="100">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>性别：</label>
                    <div class="col-sm-9">
                        <label class="radio-inline">
                            <input type="radio" value="1" name="fromSex" checked>男
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="0" name="fromSex">女
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>来电人：</label>
                    <div class="col-sm-9">
                        <input name="fromName" autocomplete="off" placeholder="请输入来电人" class="form-control" type="text"
                               maxlength="11" required="" aria-required="true">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">电子邮件：</label>
                    <div class="col-sm-9">
                        <input name="fmEmail" autocomplete="off" placeholder="请输入电子邮件" class="form-control" type="text"
                               maxlength="50">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">证件：</label>
                    <div class="col-sm-9">

                        <select id="fmCerNO" name="fmCerName" onchange="dropChgSendTextOnly(this,'fmCerName');"
                                th:with="cerTypes=${@commonServiceImpl.findCerType()}" class="form-control formSelect">
                            <option value="">--请选择--</option>
                            <option th:each="item : ${cerTypes}" th:text="${item['CSText']}"
                                    th:value="${item['CSText']}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">证件号码：</label>
                    <div class="col-sm-9">
                        <input name="fmCerNo" autocomplete="off" placeholder="" class="form-control" type="text"
                               maxlength="50">
                    </div>
                </div>
            </div>
            <div class="col-sm-8">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>来电号码(联系电话)：</label>
                    <div class="col-sm-9">
                        <input id="fromTelA" name="fromTelA" autocomplete="off" class="form-control"
                               style="width: 130px;display: inline-block;" type="text" maxlength="20" placeholder=""
                               required="" aria-required="true">
                        <input name="fromTelB" autocomplete="off" class="form-control"
                               style="width: 130px;display: inline-block;" type="text" maxlength="20" placeholder="">
                        <input name="fromTelC" autocomplete="off" class="form-control"
                               style="width: 130px;display: inline-block;" type="text" maxlength="20" placeholder="">
                    </div>
                </div>
            </div>
        </div>

        <h4 class="form-header h4">通话详情</h4>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">呼叫ID：</label>
                    <div class="col-sm-9">
                        <input name="callID" autocomplete="off" placeholder="" value="-1" class="form-control"
                               type="text" maxlength="50">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">录音ID：</label>
                    <div class="col-sm-9">
                        <input name="tapeID" autocomplete="off" placeholder="" value="-1" class="form-control"
                               type="text" maxlength="50">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>接听人：</label>
                    <div class="col-sm-9">
                        <input id="liftWorkNo" name="liftWorkNo" th:field="*{liftWorkNo}" type="hidden" >
                        <input name="liftWorker" th:field="*{liftWorker}" autocomplete="off" placeholder=""
                               class="form-control" type="text"
                               maxlength="25" required="" aria-required="true">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>分机号：</label>
                    <div class="col-sm-9">
                        <input name="liftTelNo" autocomplete="off" placeholder="" class="form-control" type="text"
                               maxlength="20" aria-required="true" required="">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>同意公开：</label>
                    <div class="col-sm-9" style="padding-right: 0;">
                        <label class="radio-inline">
                            <input type="radio" value="1" name="openFrom">是
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="0" name="openFrom" checked>否（来电人同意否？）
                        </label>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">知识库：</label>
                    <div class="col-sm-9">
                        <input autocomplete="off" placeholder="" class="form-control" type="text" maxlength="50">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="control-label col-sm-1"><span class="spRed">*</span>来电内容：</label>
                    <div class="col-sm-11">
                        <textarea class="form-control" rows="3" name="fmContent" id="fmContent" required></textarea>
                        <!--<textarea name="fmContent" id="fmContent" style="width: 99%;min-width: 99%;max-width: 99%;height: 80px;padding: 8px;border: 1px solid #ddd;"></textarea>-->
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">流水号：</label>
                    <div class="col-sm-9">
                        <input name="wsCode" readonly="readonly" autocomplete="off" placeholder="自动生成"
                               class="form-control" type="text" maxlength="20">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">查询码：</label>
                    <div class="col-sm-9">
                        <input name="wsKey" readonly="readonly" autocomplete="off" placeholder="自动生成"
                               class="form-control" type="text" maxlength="20">
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>接通时间：</label>
                    <div class="col-sm-9">
                        <input name="fromTime" autocomplete="off" id="tmFrom" placeholder="" class="form-control"
                               type="text"
                               maxlength="50" required="" aria-required="true" value="">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>挂断时间：</label>
                    <div class="col-sm-9">
                        <input name="liftEnd" id="liftEnd" autocomplete="off" placeholder="" class="form-control"
                               type="text" maxlength="20" required="" aria-required="true" onClick="endTmSet();">
                    </div>
                </div>
            </div>
        </div>

        <h4 class="form-header h4">坐席处理情况</h4>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>来电类别：</label>
                    <div class="col-sm-9">
                        <select name="dfmClaNo" id="dFmClaNo"
                                th:with="telTypes=${@commonServiceImpl.findTelType()}"
                                onchange="dropChgSendTextOnly(this,'dFmClaName');"
                                class="form-control formSelect" required>
                            <option value="">--请选择--</option>
                            <th:block th:each="item : ${telTypes}">
                                <option th:text="${item['CSText']}" th:value="${item['CSValue']}"></option>
                            </th:block>
                        </select>
                        <input type="hidden" name="dfmClaName" id="dFmClaName"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>内容类别：</label>
                    <div class="col-sm-9">
                        <input id="treeName" name="dcntAname" onclick="selectDeptTree()" class="form-control"
                               type="text" maxlength="50" required="" aria-required="true">
                        <input id="treeId" name="dcntAcode" type="hidden"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label">模板名称：</label>
                    <div class="col-sm-9">
                        <input name="sortModelNum" autocomplete="off" placeholder="" class="form-control" type="text"
                               maxlength="50">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>重复来电：</label>
                    <div class="col-sm-9">
                        <label class="radio-inline">
                            <input type="radio" value="1" name="repeatFlag">是
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="0" name="repeatFlag" checked>否（来电内容是否重复）
                        </label>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <button type="button" id="myModal" class="btn btn-default" onclick="openHistory()">历史记录</button>
            </div>
            <div class="col-sm-4">
                <div class="form-group">
                    <label class="col-sm-3 control-label"><span class="spRed">*</span>建议公开：</label>
                    <div class="col-sm-9">
                        <label class="radio-inline">
                            <input type="radio" value="1" name="openX">是
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="0" name="openX" checked>否（公开办理过程）
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="spRed">*</span>坐席处理：</label>
                    <div class="col-sm-10">
                        <select id="xDealDescSelect" class="form-control formSelect" style="margin-bottom: 5px;"
                                onchange="dropChgSendTextOnly(this,'xdealDesc');">
                            <option value="-1">---处理来电常用语---</option>
                            <option value="-110">请 XXX 调查处理后直接与来话人联系，并将处理结果抄复我办。</option>
                            <option value="-120">已当场处理</option>
                            <option value="-130">来话人反映外地（xx市）问题，建议其向当地职能部门反映</option>
                            <option value="-140">请来话人了解清楚后再做反映</option>
                            <option value="-150">已建议来话人以适当形式向市纪委监察局（12388）反映</option>
                            <option value="-160">查询知识库或相关资料，告知来话人：</option>
                            <option value="-170">建议来话人：</option>
                            <option value="-180">经查，反映问题与（工单编号：）相同，告知来话人已有市民反映，且职能部门正在办理</option>
                            <option value="-190">
                                经查，工单编号为（）的来电，相关部门正在积极的处理中，请耐心等待处理结果。12345热线公开电话的处理时限为：一般问题5个工作日内回复，较复杂问题15个工作日内给予回复，特别重大及疑难问题按照信访条列60天内回复。欢迎多提宝贵意见！
                            </option>
                            <option value="-200">记录并整理通话内容，告知来话人后续由相关职能部门进行办理</option>
                            <option value="-210">感谢您对成都市政府工作的关心和支持。欢迎多提宝贵意见！</option>
                            <option value="-220">已当即联系自来水公司（962965）、电业局（95598）、天然气公司（962777）的***号工作人员处理。</option>
                            <option value="-230">您所反映的问题我办已多次受理，并且相关部门已进行多次回复和解释，对此我办不再受理该问题，请您通过其他途径解决</option>
                            <option value="-240">据查，您反映情况不属实，并且相关部门已进行了回复和解释，对此我办不再受理该问题。</option>
                        </select>
                        <textarea name="xdealDesc" id="xdealDesc" class="form-control" rows="3"></textarea>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label">坐席备注：</label>
                    <div class="col-sm-10">
                        <select id="xSysDescSelect" class="form-control formSelect" style="margin-bottom: 5px;"
                                onchange="dropChgSendTextOnly(this,'xsysDesc');">
                            <option value="-1">---内部交流常用语---</option>
                            <option value="110">无效来电，请核查办结</option>
                            <option value="120">当场办结，请核查办结</option>
                            <option value="130">建议回电联系来话人后酌情处理</option>
                            <option value="140">反映问题与（）相同，酌情催办工单</option>
                            <option value="150">建议创建工单，请职能部门（）办理。</option>
                            <option value="150">来话人特别要求：</option>
                        </select>
                        <textarea name="xsysDesc" id="xsysDesc" rows="3" class="form-control"></textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="spRed">*</span>处理选项：</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input type="radio" value="101" name="stateFlag"
                                   onclick="stDescSet('存草稿')" checked>存草稿
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="120" name="stateFlag"
                                   onclick="stDescSet('转值班长处理')">转值班长处理
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="131" name="stateFlag"
                                   onclick="stDescSet('坐席当场解答')">当场解答
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="132" name="stateFlag"
                                   onclick="stDescSet('无效来电 当场作废')">无效来电
                        </label>
                        <input id="tbStateDesc" name="stateDesc" value="草稿" type="hidden"/>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<div class="row">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存
        </button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭
        </button>
    </div>
</div>
<div th:include="include::footer"></div>
<div id="test" style="display: block;">
    <div id="cateTree" class="ztree"></div>
</div>
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
<script type="text/javascript">
    var prefix = ctx + "system/mTelRcd";
    $("#inputForm").validate({
        rules: {
            xxxx: {
                required: true,
            },
        }
    });

    function submitHandler() {
        if ($.validate.form()) {
            var data = $('#inputForm').serializeArray();
            $.operate.saveTab(prefix + "/add", data);
        }
    }

    /*部门管理-新增-选择父部门树*/
    function selectDeptTree() {
        var options = {
            title: '内容类别选择',
            width: "380",
            url: ctx + "system/common/findContentCategories/11",
            callBack: doSubmit
        };
        $.modal.openOptions(options);
    }

    function doSubmit(index, layero) {
        var body = layer.getChildFrame('body', index);
        $("#treeId").val(body.find('#treeId').val());
        $("#treeName").val(body.find('#treeName').val());
        layer.close(index);
    }

    // $(function () {
    //     $('#liftEnd').click(function () {
    //         $(this).val(new Date().format('yyyy-MM-dd hh:mm:ss'));
    //     });
    // });

    function stDescSet(fpStr) {
        $("#tbStateDesc").val(fpStr);
    }

    $(document).ready(function () {
        $("#tmFrom").val(DateToStr());
    })

    function endTmSet() {
        $("#liftEnd").val(DateToStr());
    }

    function openHistory() {
        url = prefix +"/telOver/"+  $("#fromTelA").val();
        $.modal.open("历史记录", url);
    }

</script>
</body>
</html>